<?php
/**
 * distributor.php
 * 分销商相关
 * Author: netman
 * DateTime:  2023/9/15 10:28
 */
class Request_Api_V2_Distributor extends Request_Api_V2_Base
{
    public function __construct($request_param)
    {
        parent::__construct($request_param);
        //自定义规则
        $this->validation->rule('mid',array('Rule_Member','need_member'));
    }
    //分销商信息
    public function get_user()
    {

        return $this;
    }
    //判断是否是分销商
    public function get_isfenxiao()
    {
        return $this;
    }
    //获取我的客户下级
    public function get_sub_member()
    {
        $this->rules = [
            ['pagesize', ['digit', $this->rule_min(1)]],
            ['page', ['digit', $this->rule_min(1)]],
        ];
        return $this;
    }
    //获取分销等级
    public function get_level()
    {
        return $this;
    }
    //我的分销商列表
    public function get_subfx()
    {
        $this->rules = [
            ['group', ['digit',$this->rule_min(0)]],
            ['pagesize', ['digit', $this->rule_min(1)]],
            ['page', ['digit', $this->rule_min(1)]]
        ];
        return $this;
    }

    //成为分销商
    public function add_us()
    {
        return $this;
    }

    //分销产品列表
    public function get_product()
    {
        $this->rules = [
            ['type_id', ['not_empty','digit']],
            ['order_type', ['not_empty','digit']],
        ];
        return $this;
    }
    //订单佣金明细
    public function get_order()
    {
        $this->rules = [
            ['type_id', ['digit']],
            ['pagesize', ['digit', $this->rule_min(1)]],
            ['page', ['digit', $this->rule_min(1)]]
        ];
        return $this;
    }

    //获取分销海报
    public function get_distribution_poster()
    {
        $this->rules = [
            ['url', ['not_empty']],
            ['type_id', ['not_empty','digit']],
            ['product_id', ['not_empty','digit']]
        ];
        return $this;
    }

    //获得佣金明细查询条件
    public function get_order_condition()
    {
        return $this;
    }
    //获得分销产品查询条件
    public function get_product_condition()
    {
        return $this;
    }

    public function get_invite_image()
    {
        return $this;
    }

    public function get_commission()
    {
        $this->rules = [
            ['product_id', ['not_empty','digit']],
            ['type_id', ['not_empty','digit']],

        ];
        return $this;
    }

    public function get_fenxiao_config()
    {
        $this->rules = [
            ['fields', ['not_empty']]
        ];
        return $this;
    }



    public function get_link()
    {
        $this->rules = [
            ['url', ['not_empty']],
            ['product_id', ['not_empty','digit']],
            ['type_id', ['not_empty','digit']],
        ];
        return $this;
    }

    public function get_shop_code()
    {
        $this->rules = [
            ['url', ['not_empty']],
            ['comefrom', ['not_empty']],

        ];
        return $this;
    }

}